import Divider from 'antd/es/divider';
import { AppStore } from '../../../../store';
import { ButtonProps } from 'antd/es/button/button';

export function FloorplanDemo(props: {
    createButton: (infos: Array<{
        /** buttonName */
        name: string,
        onClick: () => void;
        buttonProps?: ButtonProps;
    }>) => JSX.Element[]
}) {
    const { createButton } = props;
    const { appState: { app } } = AppStore.useContainer();

    const CApis = [
        {
            name: '隐藏户型',
            onClick: () => app!.floorplanService.switchVisibility(false)
        },
        {
            name: '显示户型',
            onClick: () => app!.floorplanService.switchVisibility(true)
        }, {
            name: '显示房间名称',
            onClick: () => app!.floorplanService.switchRoomNameVisibility(true)
        }, {
            name: '隐藏房间名称',
            onClick: () => app!.floorplanService.switchRoomNameVisibility(false)
        }
    ]

    return <>
        <Divider> 户型</Divider>
        {createButton(CApis)}
    </>
}